home *** CD-ROM | disk | FTP | other *** search
/ Linux Cubed Series 7: Sunsite / Linux Cubed Series 7 - Sunsite Vol 1.iso / system / admin / accounts / shadow-3.001 / shadow-3.3.1-2.dif
Text File  |  1994-04-17  |  58KB  |  2,071 lines

  1. --- Makefile
  2. +++ Makefile    1994/04/17 18:01:42
  3. @@ -31,14 +31,14 @@
  4.  # seems to use /bin, USG seems to use /etc, SunOS 4.1.1 seems to use /usr/bin.
  5.  # If you define SCOLOGIN, you MUST use /etc as LOGINDIR.
  6.  # LOGINDIR = /bin
  7. -LOGINDIR = /etc
  8. +LOGINDIR = /bin
  9.  # LOGINDIR = /usr/bin
  10.  
  11.  # Define any special libraries required to access the directory routines.
  12.  # Some systems require -lndir for the directory routines.  SCO Xenix uses
  13.  # -lx for that.  Your system might need nothing.
  14.  # NDIR = -lndir
  15. -NDIR = -lx
  16. +NDIR =
  17.  # NDIR =
  18.  
  19.  # Define some stuff for Cracklib.  This assumes that libcracklib.a is
  20. @@ -47,7 +47,7 @@
  21.  # CRACKLIB=-lcrack
  22.  
  23.  # Pick your favorite C compiler and tags command
  24. -CC = cc
  25. +CC = gcc
  26.  TAGS = ctags
  27.  
  28.  # OS.  Pick one of USG (AT&T, SYSV, SYS3), BSD, SUN (SunOS 2 and 3),
  29. @@ -80,10 +80,9 @@
  30.  DEST_INCLUDE_DIR = /usr/include
  31.  
  32.  # Flags for SCO Xenix/386
  33. -CFLAGS = -O -M3 -g $(OS) -I$(DEST_INCLUDE_DIR) $(CRACKDEF)
  34. -LIBS = -lcrypt -lndbm
  35. -# LIBS = -lcrypt -ldbm
  36. -LDFLAGS = -M3 -g
  37. +CFLAGS = -O2 -m486 -fomit-frame-pointer $(OS)
  38. +LIBS =
  39. +LDFLAGS = -s -v
  40.  LTFLAGS = 
  41.  
  42.  # Flags for normal machines
  43. @@ -96,24 +95,6 @@
  44.  # LIBS =
  45.  # LDFLAGS = 
  46.  
  47. -# This should be Slibsec.a for small model, or Llibsec.a for
  48. -# large model or whatever.  MUST AGREE WITH CFLAGS!!!  For non-Intel
  49. -# machines, just use libsec.a
  50. -LIBSEC = Slibsec.a
  51. -# LIBSEC = libsec.a
  52. -
  53. -# Names for root user and group, and bin user and group.  See your
  54. -# /etc/passwd and /etc/group files.  BSD and SUN use "wheel", most
  55. -# others use "root" for RGID.
  56. -RUID = root
  57. -RGID = root
  58. -# RGID = wheel
  59. -BUID = bin
  60. -BGID = bin
  61. -
  62. -# Where the login.defs file will be copied.  Must agree with config.h
  63. -DEST_LOGIN_DEFS = /etc/login.defs
  64. -
  65.  # Rules for .L (lint) files.
  66.  .SUFFIXES: .L
  67.  LINT = lint
  68. @@ -186,9 +167,9 @@
  69.      spdbm.c dpmain.c gshadow.c gsdbm.c gspack.c sgroupio.c useradd.c \
  70.      userdel.c patchlevel.h usermod.c copydir.c mkrmdir.c groupadd.c \
  71.      groupdel.c groupmod.c tz.c console.c hushed.c getdef.c scologin.c \
  72. -    logoutd.c groups.c pwauth.c lockpw.c chowndir.c
  73. +    logoutd.c groups.c pwauth.c pwloginstr.c lockpw.c chowndir.c
  74.  
  75. -FILES1 = README patchlevel.h newgrp.c Makefile config.h pwunconv.c obscure.c \
  76. +FILES1 = README patchlevel.h newgrp.c config.h pwunconv.c obscure.c \
  77.      age.c id.c
  78.  
  79.  FILES2 = passwd.c port.c lmain.c sulogin.c pwpack.c dialup.c
  80. @@ -201,11 +182,11 @@
  81.      pwdbm.c grdbm.c gshadow.c sppack.c grpck.c
  82.  
  83.  FILES6 = gspack.c spdbm.c lastlog.h shell.c login.c sub.c dpmain.c mail.c \
  84. -    env.c pwd.h.m4 grpack.c shadow.h log.c grent.c motd.c dialup.h \
  85. +    env.c pwd.h.m4 grpack.c log.c grent.c motd.c dialup.h \
  86.      fields.c gsdbm.c utmp.c failure.c
  87.  
  88.  FILES7 = groupio.c shadowio.c sgroupio.c groups.c copydir.c mkrmdir.c \
  89. -    mkpasswd.c pwauth.c pwauth.h lastlog.c
  90. +    mkpasswd.c pwauth.c pwauth.h pwloginstr.c lastlog.c
  91.  
  92.  FILES8 = useradd.c usermod.c login.defs
  93.  
  94. @@ -218,23 +199,28 @@
  95.  MAN_1 = chage.1 chfn.1 chsh.1 id.1 login.1 newgrp.1 passwd.1 su.1 \
  96.      useradd.1 userdel.1 usermod.1 groupadd.1 groupdel.1 groupmod.1 \
  97.      groups.1 pwck.1 grpck.1
  98. -MAN_3 = shadow.3 pwauth.3
  99. +MAN_3 = shadow.3
  100.  MAN_4 = faillog.4 passwd.4 porttime.4 shadow.4
  101.  MAN_5 = login.5
  102. -MAN_8 = chpasswd.8 dpasswd.8 faillog.8 newusers.8 pwconv.8 pwunconv.8 \
  103. -    sulogin.8 mkpasswd.8 logoutd.8 pwauth.8 lastlog.8
  104. +MAN_8 = dpasswd.8 faillog.8 newusers.8 lastlog.8
  105.  
  106.  DOCS1 = $(MAN_1) $(MAN_3) $(MAN_4)
  107.  DOCS2 = $(MAN_5) $(MAN_8)
  108.  DOCS = $(DOCS1) $(DOCS2)
  109.  
  110. -BINS = su login pwconv pwunconv passwd sulogin faillog newgrp sg gpasswd \
  111. -    mkpasswd chfn chsh chage chpasswd newusers dpasswd id useradd \
  112. -    userdel usermod groupadd groupdel groupmod $(SCOLOGIN) logoutd \
  113. +BINS = su login passwd faillog newgrp sg gpasswd \
  114. +    chfn chsh chage newusers dpasswd id useradd \
  115. +    userdel usermod groupadd groupdel groupmod $(SCOLOGIN) \
  116.      groups pwck grpck lastlog
  117.  
  118.  all:    $(BINS) $(DOCS)
  119.  
  120. +Linux:
  121. +    rm -f shadow.h
  122. +    touch Linux
  123. +
  124. +$(BINS): Linux
  125. +
  126.  .PRECIOUS: libshadow.a
  127.  
  128.  libshadow.a: \
  129. @@ -257,81 +243,35 @@
  130.      libshadow.a(pwio.o) \
  131.      libshadow.a(pwpack.o) \
  132.      libshadow.a(pwauth.o) \
  133. +    libshadow.a(pwloginstr.o) \
  134.      libshadow.a(rad64.o) \
  135.      libshadow.a(spdbm.o) \
  136.      libshadow.a(shadow.o) \
  137.      libshadow.a(shadowio.o) \
  138.      libshadow.a(sppack.o) \
  139. +    libshadow.a(sppwd.o) \
  140.      libshadow.a(lockpw.o)
  141.      $(RANLIB) libshadow.a
  142.  
  143. -libsec: $(LIBSEC)(shadow.o)
  144. -    $(RANLIB) $(LIBSEC)
  145. +sppwd.o: sppwd.c
  146.  
  147. -save:
  148. -    [ ! -d save ] && mkdir save
  149. -    -cp $(LOGINDIR)/login save
  150. -    -cp /etc/mkpasswd /etc/pwconv /etc/pwunconv /etc/sulogin /etc/chpasswd \
  151. -        /etc/newusers /etc/useradd /etc/userdel /etc/usermod \
  152. -        /etc/groupadd /etc/groupdel /etc/groupmod /etc/logoutd \
  153. -        /etc/login.defs /etc/pwck /etc/grpck save
  154. -    -cp /bin/su /bin/passwd /bin/gpasswd /bin/dpasswd /bin/faillog \
  155. -        /bin/newgrp /bin/chfn /bin/chsh /bin/chage /bin/id \
  156. -        /bin/scologin save
  157. -    -cp $(DEST_INCLUDE_DIR)/dialup.h $(DEST_INCLUDE_DIR)/shadow.h \
  158. -        $(DEST_INCLUDE_DIR)/pwd.h save
  159. -
  160. -restore:
  161. -    [ -d save ]
  162. -    -(cd save ; cp login $(LOGINDIR) )
  163. -    -(cd save ; -cp mkpasswd pwconv pwunconv sulogin chpasswd \
  164. -        newusers useradd userdel usermod groupadd groupdel groupmod \
  165. -        logoutd login.defs pwck grpck /etc)
  166. -    -(cd save ; cp su passwd gpasswd dpasswd faillog newgrp chfn chsh \
  167. -        chage id scologin /bin)
  168. -    -(cd save ; cp dialup.h shadow.h pwd.h $(DEST_INCLUDE_DIR) )
  169.  
  170.  install: all
  171. -    strip $(BINS)
  172. -    cp login $(LOGINDIR)/login
  173. -    cp mkpasswd pwconv pwunconv sulogin chpasswd newusers \
  174. -        useradd userdel usermod groupadd groupdel groupmod logoutd \
  175. -        pwck grpck /etc
  176. -    cp su passwd gpasswd dpasswd faillog newgrp chfn chsh chage id /bin
  177. -    rm -f /bin/sg
  178. -    ln /bin/newgrp /bin/sg
  179. -    cp dialup.h shadow.h pwd.h $(DEST_INCLUDE_DIR)
  180. -    chown $(RUID) $(LOGINDIR)/login /etc/pwconv /etc/pwunconv /etc/sulogin \
  181. -        /bin/su /bin/passwd /bin/gpasswd /bin/newgrp /etc/mkpasswd \
  182. -        /bin/dpasswd /bin/chsh /bin/chfn /bin/chage /etc/useradd \
  183. -        /etc/userdel /etc/usermod /etc/groupadd /etc/groupdel \
  184. -        /etc/groupmod /etc/logoutd /etc/pwck /etc/grpck
  185. -    chgrp $(RGID) $(LOGINDIR)/login /etc/pwconv /etc/pwunconv /etc/sulogin \
  186. -        /bin/su /bin/passwd /bin/gpasswd /bin/newgrp /etc/mkpasswd \
  187. -        /bin/dpasswd /bin/chsh /bin/chfn /bin/chage /etc/useradd \
  188. -        /etc/userdel /etc/usermod /etc/groupadd /etc/groupdel \
  189. -        /etc/groupmod /etc/logoutd /etc/pwck /etc/grpck
  190. -    chown $(BUID) /bin/faillog /bin/id $(DEST_INCLUDE_DIR)/shadow.h \
  191. -        $(DEST_INCLUDE_DIR)/dialup.h $(DEST_INCLUDE_DIR)/pwd.h
  192. -    chgrp $(BGID) /bin/faillog /bin/id $(DEST_INCLUDE_DIR)/shadow.h \
  193. -        $(DEST_INCLUDE_DIR)/dialup.h $(DEST_INCLUDE_DIR)/pwd.h
  194. -    chmod 700 /etc/pwconv /etc/pwunconv /etc/sulogin /etc/mkpasswd \
  195. -        /etc/chpasswd /etc/newusers /bin/dpasswd /etc/logoutd \
  196. -        /etc/useradd /etc/userdel /etc/usermod /etc/groupadd \
  197. -        /etc/groupdel /etc/groupmod /etc/pwck /etc/grpck
  198. -    chmod 4711 $(LOGINDIR)/login /bin/su /bin/passwd /bin/gpasswd \
  199. -        /bin/newgrp /bin/chfn /bin/chsh /bin/chage
  200. -    chmod 711 /bin/faillog /bin/id
  201. -    chmod 444 $(DEST_INCLUDE_DIR)/shadow.h $(DEST_INCLUDE_DIR)/dialup.h \
  202. -        $(DEST_INCLUDE_DIR)/pwd.h
  203. -    [ -f $(DEST_LOGIN_DEFS) ] || (cp login.defs $(DEST_LOGIN_DEFS) ; \
  204. -        chown $(RUID) $(DEST_LOGIN_DEFS) ; \
  205. -        chgrp $(RGID) $(DEST_LOGIN_DEFS) ; \
  206. -        chmod 600 $(DEST_LOGIN_DEFS) )
  207. -    [ -z "$(SCOLOGIN)" ] || (cp scologin /bin/login ; \
  208. -        chown $(RUID) /bin/login ; \
  209. -        chgrp $(RGID) /bin/login ; \
  210. -        chmod 755 /bin/login )
  211. +    install -m 644 $(MAN_1) /usr/man/man1
  212. +    install -m 644 $(MAN_3) /usr/man/man3
  213. +    install -m 644 $(MAN_4) /usr/man/man4
  214. +    install -m 644 $(MAN_5) /usr/man/man5
  215. +    install -m 644 $(MAN_8) /usr/man/man8
  216. +    install groups /usr/bin
  217. +    install -m4755 chfn chsh chage /usr/bin
  218. +    install -m4755 login $(LOGINDIR)/login
  219. +    install -m744 newusers \
  220. +        useradd userdel usermod groupadd groupdel groupmod \
  221. +        faillog lastlog pwck grpck /usr/sbin
  222. +    install -m755 dpasswd id /bin
  223. +    install -m4755 su passwd gpasswd newgrp /bin
  224. +    ln -sf newgrp /bin/sg
  225. +    install -m644 libshadow.a /usr/lib
  226.  
  227.  lint:    su.lint login.lint pwconv.lint pwunconv.lint passwd.lint sulogin.lint \
  228.      faillog.lint newgrp.lint gpasswd.lint mkpasswd.lint chfn.lint \
  229. @@ -531,8 +471,8 @@
  230.  pwd.h.m4:
  231.      [ -f s.pwd.h.m4 ] && $(GET) $(GFLAGS) s.pwd.h.m4
  232.  
  233. -pwd.h: pwd.h.m4
  234. -    m4 $(OS) < pwd.h.m4 > pwd.h
  235. +#pwd.h: pwd.h.m4
  236. +#    m4 $(OS) < pwd.h.m4 > pwd.h
  237.  
  238.  logoutd: logoutd.o libshadow.a
  239.      $(CC) -o logoutd $(LDFLAGS) logoutd.o libshadow.a
  240. @@ -557,70 +497,70 @@
  241.  susetup.c: setup.c
  242.      cp setup.c susetup.c
  243.  
  244. -susetup.o: config.h susetup.c pwd.h
  245. +susetup.o: config.h susetup.c
  246.      $(CC) -c $(CFLAGS) -DSU susetup.c
  247.  
  248.  scologin: scologin.o
  249.      $(CC) -o scologin $(LDFLAGS) scologin.o -lsocket
  250.  
  251. -passwd.o: config.h shadow.h pwd.h pwauth.h
  252. -lmain.o: config.h lastlog.h faillog.h pwd.h pwauth.h
  253. -smain.o: config.h lastlog.h pwd.h shadow.h pwauth.h
  254. -sub.o: pwd.h
  255. -setup.o: config.h pwd.h
  256. +passwd.o: config.h pwauth.h
  257. +lmain.o: config.h lastlog.h faillog.h pwauth.h
  258. +smain.o: config.h lastlog.h pwauth.h
  259. +sub.o:
  260. +setup.o: config.h
  261.  mkrmdir.o: config.h
  262.  utmp.o: config.h
  263.  mail.o: config.h
  264.  motd.o: config.h
  265. -age.o: config.h pwd.h
  266. -log.o: config.h lastlog.h pwd.h
  267. +age.o: config.h
  268. +log.o: config.h lastlog.h
  269.  shell.o: config.h
  270. -entry.o: config.h shadow.h pwd.h
  271. -hushed.o: config.h pwd.h
  272. -valid.o: config.h pwd.h
  273. +entry.o: config.h
  274. +hushed.o: config.h
  275. +valid.o: config.h
  276.  failure.o: faillog.h config.h
  277. -faillog.o: faillog.h config.h pwd.h
  278. -newgrp.o: config.h shadow.h pwd.h
  279. -mkpasswd.o: config.h shadow.h pwd.h
  280. -gpmain.o: config.h pwd.h
  281. -chfn.o: config.h pwd.h
  282. -chsh.o: config.h pwd.h
  283. -chage.o: config.h shadow.h pwd.h
  284. -pwconv.o: config.h shadow.h
  285. -pwunconv.o: config.h shadow.h pwd.h
  286. -chpasswd.o: config.h shadow.h pwd.h
  287. -id.o: pwd.h
  288. -newusers.o: config.h shadow.h pwd.h
  289. +faillog.o: faillog.h config.h
  290. +newgrp.o: config.h
  291. +mkpasswd.o: config.h
  292. +gpmain.o: config.h
  293. +chfn.o: config.h
  294. +chsh.o: config.h
  295. +chage.o: config.h
  296. +pwconv.o: config.h
  297. +pwunconv.o: config.h
  298. +chpasswd.o: config.h
  299. +id.o:
  300. +newusers.o: config.h
  301.  dpmain.o: config.h dialup.h
  302. -useradd.o: config.h shadow.h pwd.h pwauth.h
  303. -userdel.o: config.h shadow.h pwd.h pwauth.h
  304. -usermod.o: config.h shadow.h pwd.h pwauth.h
  305. -groupadd.o: config.h shadow.h
  306. -groupdel.o: config.h shadow.h
  307. -groupmod.o: config.h shadow.h
  308. +useradd.o: config.h pwauth.h
  309. +userdel.o: config.h pwauth.h
  310. +usermod.o: config.h pwauth.h
  311. +groupadd.o: config.h
  312. +groupdel.o: config.h
  313. +groupmod.o: config.h
  314.  logoutd.o: config.h
  315.  sulogin.o: config.h pwauth.h
  316.  copydir.o: config.h
  317.  chowndir.o: config.h
  318. -pwck.o: config.h shadow.h pwd.h
  319. -grpck.o: config.h shadow.h pwd.h
  320. +pwck.o: config.h
  321. +grpck.o: config.h
  322.  
  323. -libshadow.a(shadow.o): shadow.h config.h
  324. -libshadow.a(shadowio.o): shadow.h
  325. -libshadow.a(grent.o): config.h shadow.h
  326. -libshadow.a(sgroupio.o): shadow.h
  327. +libshadow.a(shadow.o): config.h
  328. +libshadow.a(shadowio.o):
  329. +libshadow.a(grent.o): config.h
  330. +libshadow.a(sgroupio.o):
  331.  libshadow.a(dialup.o): dialup.h
  332.  libshadow.a(dialchk.o): dialup.h config.h
  333.  libshadow.a(getdef.o): config.h
  334. -libshadow.a(pwdbm.o): config.h pwd.h
  335. -libshadow.a(spdbm.o): config.h shadow.h
  336. +libshadow.a(pwdbm.o): config.h
  337. +libshadow.a(spdbm.o): config.h
  338.  libshadow.a(grdbm.o): config.h
  339.  libshadow.a(gshadow.o): config.h
  340. -libshadow.a(gsdbm.o): config.h shadow.h
  341. +libshadow.a(gsdbm.o): config.h
  342.  libshadow.a(pwauth.o): config.h pwauth.h
  343. -libshadow.a(pwpack.o): config.h pwd.h
  344. -libshadow.a(pwent.o): config.h pwd.h
  345. -libshadow.a(pwio.o): pwd.h
  346. +libshadow.a(pwpack.o): config.h
  347. +libshadow.a(pwent.o): config.h
  348. +libshadow.a(pwio.o):
  349.  libshadow.a(getpass.o): config.h
  350.  libshadow.a(encrypt.o): config.h
  351.  libshadow.a(port.o): port.h
  352. @@ -628,10 +568,10 @@
  353.  libshadow.a(lockpw.o):
  354.  
  355.  clean:
  356. -    -rm -f susetup.c *.o a.out core npasswd nshadow *.pag *.dir pwd.h
  357. +    -rm -f susetup.c *.o a.out core npasswd nshadow *.pag *.dir
  358.  
  359.  clobber: clean
  360. -    -rm -f $(BINS) *.lint *.L libshadow.a
  361. +    -rm -f $(BINS) *.lint *.L libshadow.a Linux
  362.  
  363.  nuke:    clobber
  364.      -for file in * ; do \
  365. --- README.linux
  366. +++ README.linux    1994/04/17 18:07:14
  367. @@ -0,0 +1,39 @@
  368. +
  369. +I have uploaded a new version of Linux-specific patches for shadow-3.3.1
  370. +into the Incoming directory of sunsite.unc.edu.
  371. +
  372. +File name:    shadow-3.3.1-2.dif
  373. +
  374. +I have put together patches from the following people:
  375. +-  Riku Meskanen, <mesrik@tukki.jyu.fi>
  376. +-  Mohan Kokal, <magnus@cegt201.bradley.edu>
  377. +
  378. +Partial list of the enhancements and bug fixes:
  379. +- add new variable LOGIN_STRING to /etc/login.defs which
  380. +  allows administrator control "Password :" string.
  381. +- removed the problem when login trashing TERM= variable on
  382. +  normal login even when -p is *not* defined.
  383. +- The shadow library is also installed.
  384. +- The "lastlog" file now also updates the hostname of the last login.
  385. +- "su" makes better syslog-messages.
  386. +- "lastlog" now works.
  387. +
  388. +To install this package do a "make". If everything compiles, do a
  389. +"make install" as root. Do not forget to update your "/etc/login.defs"!
  390. +Otherwise, your "login" won't work!!!
  391. +
  392. +More detailed: You have to fetch the original source code of the
  393. +shadow 3.3.1 package. (It is on sunsite, "shadow-3.3.1.tar.gz")
  394. +Unpack that source package with "tar xzf shadow-3.3.1.tar.gz" and go into
  395. +the source directory ("cd shadow-3.3.1"). Then you have to apply the Linux
  396. +patches with "patch -s -p0 < shadow-3.3.1-2.dif". Then "make; make install".
  397. +
  398. +Please send me any further bug fixes for the next release.
  399. +
  400. +
  401. +Florian  La Roche,    flla@stud.uni-sb.de
  402. +
  403. +P.S.: I do *not* know, when the next official release of the shadow-system
  404. +      will be...
  405. +
  406. +
  407. --- chage.1
  408. +++ chage.1    1994/04/17 17:59:13
  409. @@ -8,7 +8,7 @@
  410.  .\"
  411.  .TH CHAGE 1
  412.  .SH NAME
  413. -chage \- change user password expirate information
  414. +chage \- change user password expire information
  415.  .SH SYNOPSIS
  416.  \fBchage\fR [ \fB-m \fImindays\fR ] [ \fB-M \fImaxdays\fR ]
  417.  [ \fB-d \fIlastday\fR ] [ \fB-I \fIinactive\fR ]
  418. @@ -16,20 +16,20 @@
  419.  .sp 1
  420.  \fBchage\fR -l \fIuser\fR
  421.  .SH DESCRIPTION
  422. -\fIchage\f changes the number of days between password changes and the
  423. +\fIchage\fR changes the number of days between password changes and the
  424.  date of the last password change.
  425.  This information is used by the system to determine when a user must
  426.  change her password.
  427. -The \fIchage\f command is restricted to the root user, except for the
  428. +The \fIchage\fR command is restricted to the root user, except for the
  429.  \fB-l\fR option, which may be used by an unprivileged user to determine
  430.  when her password or account is due to expire.
  431.  .PP
  432. -With the \fB-m\fR option, the value of \fImindays\f is the minimum number
  433. +With the \fB-m\fR option, the value of \fImindays\fR is the minimum number
  434.  of days between password changes.
  435.  A value of zero for this field indicates that the user may change
  436.  her password at any time.
  437.  .PP
  438. -With the \fB-M\fR option, the value of \fImaxdays\f is the maximum number
  439. +With the \fB-M\fR option, the value of \fImaxdays\fR is the maximum number
  440.  of days during which a password is valid.
  441.  When \fImaxdays\fR plus \fIlastday\fR is less than the current day,
  442.  the user will be required to change her password before being
  443. @@ -37,7 +37,7 @@
  444.  This occurance can be planned for in advance by use of the \fB-W\fR option,
  445.  which provides the user with advance warning.
  446.  .PP
  447. -With the \fB-d\fR option, the value of \fIlastday\f is the number of days
  448. +With the \fB-d\fR option, the value of \fIlastday\fR is the number of days
  449.  since January 1st, 1970 when the password was last changed.
  450.  The date may also be expressed in the format MM/DD/YY (or the format more
  451.  commonly used in your area).
  452. @@ -63,16 +63,11 @@
  453.  The \fIwarndays\fR option is the number of days prior to the password
  454.  expiring that a user will be warned her password is about to expire.
  455.  .PP
  456. -All of the above values are stored exactly as days when the shadow
  457. -password file is used, but are converted to and from weeks when the
  458. -standard password file is used.
  459. -Because of this conversion, rounding errors may result.
  460. -.PP
  461. -If none of the options are selected, \fIchage\f operates in an interactive
  462. +If none of the options are selected, \fIchage\fR operates in an interactive
  463.  fashion, prompting the user with the current values for all of the fields.
  464.  Enter the new value to change the field, or leave the line blank to use
  465.  the current value.
  466. -The current value is displayed between a pair of \fB[ ]\f marks.
  467. +The current value is displayed between a pair of \fB[ ]\fR marks.
  468.  .SH Files
  469.  /etc/passwd \- user account information
  470.  .br
  471. --- chfn.1
  472. +++ chfn.1    1994/04/17 17:59:13
  473. @@ -15,25 +15,25 @@
  474.  [ \fB-w \fIwork_ph\fR ] [ \fB-h \fIhome_ph\fR ] [ \fB-o \fIother\fR ]
  475.  [ \fIuser\fR ]
  476.  .SH DESCRIPTION
  477. -\fIchfn\f changes user fullname, office number, office extension, and home
  478. +\fIchfn\fR changes user fullname, office number, office extension, and home
  479.  phone number information for a user's account. 
  480. -This information is typically printed by \fIfinger(1)\f and similiar
  481. +This information is typically printed by \fIfinger(1)\fR and similiar
  482.  programs.
  483.  A normal user may only change the fields for their own account,
  484.  the super user may change the fields for any account.
  485. -Also, only the super user may use the \fB-o\f option to change the
  486. +Also, only the super user may use the \fB-o\fR option to change the
  487.  undefined portions of the GCOS field.
  488.  .PP
  489.  The only restrictions placed on the contents of the fields is that no
  490.  control characters may be present, nor any of comma, colon, or equal sign.
  491. -The \fIother\f field does not have this restriction, and is used to
  492. +The \fIother\fR field does not have this restriction, and is used to
  493.  store accounting information used by other applications.
  494.  .PP
  495. -If none of the options are selected, \fIchfn\f operates in an interactive
  496. +If none of the options are selected, \fIchfn\fR operates in an interactive
  497.  fashion, prompting the user with the current values for all of the fields.
  498.  Enter the new value to change the field, or leave the line blank to use
  499.  the current value.
  500. -The current value is displayed between a pair of \fB[ ]\f marks.
  501. +The current value is displayed between a pair of \fB[ ]\fR marks.
  502.  Without options, chfn prompts for the current user account.
  503.  .SH Files
  504.  /etc/passwd \- user account information
  505. --- config.h
  506. +++ config.h    1994/04/17 17:59:13
  507. @@ -12,6 +12,9 @@
  508.   * no warrantee of any kind.
  509.   */
  510.  
  511. +#include <sys/types.h>
  512. +#include <stdio.h>
  513. +
  514.  /*
  515.   * Configuration file for login.
  516.   *
  517. @@ -19,6 +22,8 @@
  518.   */
  519.  
  520.  
  521. +#define LASTFILE "/var/adm/lastlog"
  522. +
  523.  /*
  524.   * Pathname to the run-time configuration definitions file.
  525.   */
  526. @@ -53,7 +58,7 @@
  527.   * Define DOUBLESIZE to use 16 character passwords
  528.   */
  529.  
  530. -#define DOUBLESIZE
  531. +#undef DOUBLESIZE
  532.  
  533.  /*
  534.   * Define AGING if you want the password aging checks made.
  535. @@ -82,7 +87,7 @@
  536.   */
  537.  
  538.  #define RLOGIN
  539. -#undef UT_HOST
  540. +#define UT_HOST
  541.  
  542.  /*
  543.   * Define the "success" code from ruserok().  Most modern systems use 0
  544. @@ -96,9 +101,9 @@
  545.   * Select one of the following
  546.   */
  547.  
  548. -#define DIR_XENIX    /* include <sys/ndir.h>, use (struct direct)    */
  549. +/* #define DIR_XENIX    /* include <sys/ndir.h>, use (struct direct)    */
  550.  /* #define DIR_BSD    /* include <ndir.h>, use (struct direct)    */
  551. -/* #define DIR_SYSV    /* include <dirent.h>, use (struct dirent)    */
  552. +#define DIR_SYSV    /* include <dirent.h>, use (struct dirent)    */
  553.  
  554.  /*
  555.   * Various system environment definitions.
  556. @@ -106,23 +111,23 @@
  557.  
  558.  #define    HAVE_ULIMIT    /* Define if your UNIX supports ulimit()    */
  559.  #undef    HAVE_RLIMIT    /* Define if your UNIX supports setrlimit()     */
  560. -#define    GETPWENT    /* Define if you want my GETPWENT(3) routines    */
  561. -#define    GETGRENT    /* Define if you want my GETGRENT(3) routines    */
  562. +#undef    GETPWENT    /* Define if you want my GETPWENT(3) routines    */
  563. +#undef    GETGRENT    /* Define if you want my GETGRENT(3) routines    */
  564.  #define    NEED_AL64    /* Define if library does not include a64l()    */
  565. -#define    NEED_MKDIR    /* Define if system does not have mkdir()    */
  566. -#define    NEED_RMDIR    /* Define if system does not have rmdir()    */
  567. -#define    NEED_RENAME    /* Define if system does not have rename()    */
  568. -#define    NEED_STRSTR    /* Define if library does not include strstr()    */
  569. +#undef    NEED_MKDIR    /* Define if system does not have mkdir()    */
  570. +#undef    NEED_RMDIR    /* Define if system does not have rmdir()    */
  571. +#undef    NEED_RENAME    /* Define if system does not have rename()    */
  572. +#undef    NEED_STRSTR    /* Define if library does not include strstr()    */
  573.  #undef    NEED_PUTPWENT    /* Define if library does not include putpwent()*/
  574. -#define    SIGTYPE    int    /* Type returned by signal()                    */
  575. +#define    SIGTYPE    void    /* Type returned by signal()                    */
  576.  
  577.  /*
  578.   * These definitions MUST agree with the values defined in <pwd.h>.
  579.   */
  580.  
  581.  #undef    BSD_QUOTA    /* the pw_quota field exists */
  582. -#define    ATT_AGE        /* the pw_age field exists */
  583. -#define    ATT_COMMENT    /* the pw_comment field exists */
  584. +#undef    ATT_AGE        /* the pw_age field exists */
  585. +#undef    ATT_COMMENT    /* the pw_comment field exists */
  586.  
  587.  #define    UID_T    uid_t    /* set to be the type of UID's */
  588.  #define    GID_T    gid_t    /* set to be the type of GID's */
  589. @@ -182,7 +187,7 @@
  590.   * from single user to multi-user mode.
  591.   */
  592.  
  593. -#define    TELINIT        /**/
  594. +#define    TELINIT        "/sbin/telinit"
  595.  #define    RUNLEVEL    "2"    /**/
  596.  
  597.  /*
  598. @@ -190,5 +195,6 @@
  599.   * HAS_CRONTAB.  If your system can "atrm <user>", define HAS_ATRM.
  600.   */
  601.  
  602. -#undef    HAS_CRONTAB
  603. -#undef    HAS_ATRM
  604. +#define CRONTAB_REM "crontab -d -u %s"
  605. +#define ATRUN_REM   "atrm %s"
  606. +
  607. --- copydir.c
  608. +++ copydir.c    1994/04/17 17:59:13
  609. @@ -213,8 +213,8 @@
  610.               */
  611.  
  612.              mkdir (dst_name, sb.st_mode & 0777);
  613. -            chown (dst_name, uid == -1 ? sb.st_uid:uid,
  614. -                gid == -1 ? sb.st_gid:gid);
  615. +            chown (dst_name, uid == (UID_T)-1 ? sb.st_uid:uid,
  616. +                gid == (GID_T)-1 ? sb.st_gid:gid);
  617.  
  618.              if (copy_tree (src_name, dst_name, uid, gid)) {
  619.                  err++;
  620. @@ -250,8 +250,8 @@
  621.  
  622.          if (! S_ISREG (sb.st_mode)) {
  623.              if (mknod (dst_name, sb.st_mode & ~07777, sb.st_rdev) ||
  624. -                chown (dst_name, uid == -1 ? sb.st_uid:uid,
  625. -                    gid == -1 ? sb.st_gid:gid) ||
  626. +                chown (dst_name, uid == (UID_T)-1 ? sb.st_uid:uid,
  627. +                    gid == (GID_T)-1 ? sb.st_gid:gid) ||
  628.                      chmod (dst_name, sb.st_mode & 07777)) {
  629.                  err++;
  630.                  break;
  631. @@ -269,8 +269,8 @@
  632.              break;
  633.          }
  634.          if ((ofd = open (dst_name, O_WRONLY|O_CREAT, 0)) < 0 ||
  635. -            chown (dst_name, uid == -1 ? sb.st_uid:uid,
  636. -                    gid == -1 ? sb.st_gid:gid) ||
  637. +            chown (dst_name, uid == (UID_T)-1 ? sb.st_uid:uid,
  638. +                    gid == (GID_T)-1 ? sb.st_gid:gid) ||
  639.                  chmod (dst_name, sb.st_mode & 07777)) {
  640.              close (ifd);
  641.              err++;
  642. --- faillog.4
  643. +++ faillog.4    1994/04/17 17:59:13
  644. @@ -31,6 +31,6 @@
  645.  
  646.  .DE
  647.  .SH Files
  648. -/usr/adm/faillog \- login failure log
  649. +/var/adm/faillog \- login failure log
  650.  .SH See Also
  651.  faillog(8)
  652. --- faillog.8
  653. +++ faillog.8    1994/04/17 17:59:13
  654. @@ -13,7 +13,7 @@
  655.  /etc/faillog [ -u uid ] [ -a ] [ -t days ] [ -m max ] [ -pr ] 
  656.  .SH DESCRIPTION
  657.  \fIfaillog\fR formats the contents of the failure log,
  658. -\fI/usr/adm/faillog\fR, and maintains failure counts and
  659. +\fI/var/adm/faillog\fR, and maintains failure counts and
  660.  limits.
  661.  The order of the arguments to \fIfaillog\fR is significant.
  662.  Each argument is processed immediately in the order given.
  663. @@ -31,14 +31,14 @@
  664.  It is meaningless with the \fB-r\fR flag.
  665.  .PP
  666.  The \fB-r\fR flag is used to reset the count of login failures.
  667. -Write access to \fI/usr/adm/faillog\fR is required for
  668. +Write access to \fI/var/adm/faillog\fR is required for
  669.  this option.
  670.  Entering \fB-u login-name\fR will cause only the failure count
  671.  for \fBlogin-name\fR to be reset.
  672.  .PP
  673.  The \fB-m\fR flag is used to set the maximum number of login
  674.  failures before the account is disabled.
  675. -Write access to \fB/usr/adm/faillog\fR is required for this
  676. +Write access to \fB/var/adm/faillog\fR is required for this
  677.  option.
  678.  Entering \fB-m max\fR will cause all accounts to be disabled
  679.  after \fBmax\fR failed logins occur.
  680. @@ -60,7 +60,7 @@
  681.  failure, you must explicitly request the user with the \fB-u\fR flag,
  682.  or print out all users with the \fB-a\fR flag.
  683.  .SH Files
  684. -/usr/adm/faillog \- failure logging file
  685. +/var/adm/faillog \- failure logging file
  686.  .SH See Also
  687.  login(1),
  688.  faillog(4)
  689. --- faillog.h
  690. +++ faillog.h    1994/04/17 17:59:13
  691. @@ -19,7 +19,7 @@
  692.   * is indexed in that fashion.
  693.   */
  694.  
  695. -#ifdef    SVR4
  696. +#if defined(SVR4) || defined(__linux__)
  697.  #define    FAILFILE    "/var/adm/faillog"
  698.  #else
  699.  #define    FAILFILE    "/usr/adm/faillog"
  700. --- failure.c
  701. +++ failure.c    1994/04/17 17:59:13
  702. @@ -183,7 +183,11 @@
  703.      char    lasttimeb[32];
  704.      char    *lasttime = lasttimeb;
  705.  #else
  706. +#if    __STDC__
  707. +    char    lasttime[256];
  708. +#else
  709.      char    *lasttime;
  710. +#endif
  711.  #endif
  712.  
  713.      if (fail->fail_cnt == 0)
  714. --- getdef.c
  715. +++ getdef.c    1994/04/17 17:59:13
  716. @@ -62,6 +62,7 @@
  717.      { "ISSUE_FILE_ENAB",        NULL },
  718.      { "KILLCHAR",            NULL },
  719.      { "LASTLOG_ENAB",        NULL },
  720. +    { "LOGIN_STRING",        NULL },
  721.      { "LOG_UNKFAIL_ENAB",        NULL },
  722.      { "MAIL_CHECK_ENAB",        NULL },
  723.      { "MAIL_DIR",            NULL },
  724. --- gpmain.c
  725. +++ gpmain.c    1994/04/17 17:59:13
  726. @@ -329,7 +329,9 @@
  727.      struct    sgrp    *getsgnam ();
  728.  #endif
  729.      struct    passwd    *pw = 0;
  730. +#ifndef __linux__
  731.      struct    passwd    *getpwuid ();
  732. +#endif
  733.      struct    passwd    *getpwnam ();
  734.  
  735.      /*
  736. --- groups.1
  737. +++ groups.1    1994/04/17 17:59:13
  738. @@ -24,7 +24,7 @@
  739.  If the value does not have a corresponding entry in
  740.  \fB/etc/group\fR, the value will be displayed as the numerical group value.
  741.  The optional \fIuser\fR parameter will display the groups for the named
  742. -\fIuser\R.
  743. +\fIuser\fR.
  744.  .SH Note
  745.  Systems which do not support concurrent group sets will have the information
  746.  from \fB/etc/group\fR reported.
  747. --- groups.c
  748. +++ groups.c    1994/04/17 17:59:13
  749. @@ -11,6 +11,8 @@
  750.  
  751.  static    char    sccsid[] = "@(#)groups.c    3.2    09:47:19    25 Nov 1991";
  752.  
  753. +#include "ngroups.h"
  754. +#include "config.h"
  755.  #include "stdio.h"
  756.  #include "pwd.h"
  757.  #include "grp.h"
  758. @@ -54,19 +56,13 @@
  759.  char    **argv;
  760.  {
  761.      int    ngroups;
  762. -#if NGROUPS > 0
  763. -#if NGROUPS > 100
  764. -    gid_t    *groups;
  765. -#else
  766. -    gid_t    groups[NGROUPS];
  767. -#endif
  768. +#ifdef NGROUPS_MAX
  769. +    GID_T    *groups;
  770.      int    i;
  771.  #else
  772.      char    *logname;
  773. -    char    *getlogin();
  774.  #endif
  775.      struct    group    *gr;
  776. -    struct    group    *getgrgid();
  777.  
  778.      if (argc == 1) {
  779.  
  780. @@ -75,7 +71,7 @@
  781.           * for the current user.
  782.           */
  783.  
  784. -#if NGROUPS > 0
  785. +#ifdef NGROUPS_MAX
  786.          /*
  787.           * This system supports concurrent group sets, so
  788.           * I can ask the system to tell me which groups are
  789. @@ -83,9 +79,7 @@
  790.           */
  791.  
  792.          ngroups = getgroups (0, 0);
  793. -#if NGROUPS > 100
  794. -        groups = (gid_t *) malloc (ngroups * sizeof (int *));
  795. -#endif
  796. +        groups = (GID_T *) malloc (ngroups * sizeof (GID_T));
  797.          getgroups (ngroups, groups);
  798.  
  799.          /*
  800. --- gshadow.c
  801. +++ gshadow.c    1994/04/17 17:59:13
  802. @@ -135,8 +135,8 @@
  803.      long    atol ();
  804.      int    i;
  805.  
  806. -    strncpy (sgrbuf, string, (int) sizeof sgrbuf - 1);
  807. -    sgrbuf[sizeof sgrbuf - 1] = '\0';
  808. +    strncpy (sgrbuf, string, (int) sizeof (sgrbuf) - 1);
  809. +    sgrbuf[sizeof (sgrbuf) - 1] = '\0';
  810.  
  811.      if (cp = strrchr (sgrbuf, '\n'))
  812.          *cp = '\0';
  813. @@ -157,7 +157,7 @@
  814.       * the line is invalid.
  815.       */
  816.  
  817. -    if (cp || i != FIELDS)
  818. +    if ((cp && *cp) || i != FIELDS)
  819.          return 0;
  820.  
  821.      sgroup.sg_name = fields[0];
  822. --- id.c
  823. +++ id.c    1994/04/17 17:59:14
  824. @@ -20,6 +20,7 @@
  825.   *    the concurrent group set if the current system supports it.
  826.   */
  827.  
  828. +#include "ngroups.h"
  829.  #include <sys/types.h>
  830.  #include <stdio.h>
  831.  #include <grp.h>
  832. @@ -32,11 +33,7 @@
  833.  
  834.  usage ()
  835.  {
  836. -#if NGROUPS > 0
  837.      fprintf (stderr, "usage: id [ -a ]\n");
  838. -#else
  839. -    fprintf (stderr, "usage: id\n");
  840. -#endif
  841.      exit (1);
  842.  }
  843.  
  844. @@ -46,21 +43,13 @@
  845.  char    **argv;
  846.  {
  847.      int    id;
  848. -#if NGROUPS > 0
  849. -#if NGROUPS > 100
  850.      GID_T    *groups;
  851. -#else
  852. -    GID_T    groups[NGROUPS];
  853. -#endif
  854.      int    ngroups;
  855.      int    aflg = 0;
  856. -#endif
  857. -    struct    passwd    *pw,
  858. -            *getpwuid();
  859. -    struct    group    *gr,
  860. -            *getgrgid();
  861.  
  862. -#if NGROUPS > 0
  863. +    struct    passwd    *pw;
  864. +    struct    group    *gr;
  865. +
  866.      /*
  867.       * See if the -a flag has been given to print out the
  868.       * concurrent group set.
  869. @@ -72,10 +61,6 @@
  870.          else
  871.              aflg = 1;
  872.      }
  873. -#else
  874. -    if (argc > 1)
  875. -        usage ();
  876. -#endif
  877.  
  878.      /*
  879.       * Print out the real user ID and group ID.  If the user or
  880. @@ -109,7 +94,6 @@
  881.          else
  882.              printf (" egid=%d", id);
  883.      }
  884. -#if NGROUPS > 0
  885.  
  886.      /*
  887.       * Print out the concurrent group set if the user has requested
  888. @@ -117,21 +101,20 @@
  889.       * names.
  890.       */
  891.  
  892. -    if (aflg && (ngroups = getgroups (0, 0)) != -1) {
  893. +    if (aflg && NGROUPS_MAX > 1 && (ngroups = getgroups (0, 0)) > 0) {
  894.          int    i;
  895.  
  896. -#if NGROUPS > 100
  897.          /*
  898.           * The size of the group set is determined so an array
  899.           * large enough to hold it can be allocated.
  900.           */
  901.  
  902. -        if (groups = (int *) malloc (ngroups * sizeof *groups)) {
  903. +        if (!(groups = (GID_T *) malloc (ngroups * sizeof *groups))) {
  904.              putchar ('\n');
  905.              perror ("out of memory");
  906.              exit (1);
  907.          }
  908. -#endif
  909. +
  910.          /*
  911.           * Start off the group message.  It will be of the format
  912.           *
  913. @@ -153,7 +136,6 @@
  914.                  printf ("%d", (int) groups[i]);
  915.          }
  916.      }
  917. -#endif
  918.  
  919.      /*
  920.       * Finish off the line.
  921. --- lastlog.c
  922. +++ lastlog.c    1994/04/17 17:59:14
  923. @@ -26,8 +26,6 @@
  924.  #define    strrchr    rindex
  925.  #endif
  926.  
  927. -#define LASTFILE "/usr/adm/lastlog"
  928. -
  929.  #include "config.h"
  930.  #include "lastlog.h"
  931.  
  932. --- lastlog.h
  933. +++ lastlog.h    1994/04/17 17:59:14
  934. @@ -1,3 +1,6 @@
  935. +#ifndef _LASTLOG_H
  936. +#define _LASTLOG_H
  937. +
  938.  /*
  939.   * Copyright 1989, 1990, 1992, 1993, John F. Haugh II
  940.   * All rights reserved.
  941. @@ -25,7 +28,7 @@
  942.  struct    lastlog    {
  943.      time_t    ll_time;
  944.      char    ll_line[8];
  945. -#ifdef    SVR4
  946.      char    ll_host[16];
  947. -#endif
  948.  };
  949. +
  950. +#endif
  951. --- lmain.c
  952. +++ lmain.c    1994/04/17 17:59:14
  953. @@ -511,6 +511,13 @@
  954.  #ifdef    RLOGIN
  955.      if (term[5] != '\0')        /* see if anything after "TERM=" */
  956.          addenv (term);
  957. +    /* if no flag(s) and TERM= is set then normal login */
  958. +    else if (!pflg && !rflg && !fflg && !hflg
  959. +        && (tmp = getenv("TERM")) != NULL) {
  960. +        /* preserve TERM= from getty */
  961. +        strcat(strcpy(term,"TERM="),tmp);
  962. +        addenv(term);
  963. +    }
  964.  #endif
  965.      /*
  966.       * Add the timezone environmental variable so that time functions
  967. @@ -868,10 +875,8 @@
  968.          if (getdef_bool ("LASTLOG_ENAB") && lastlog.ll_time != 0) {
  969.              printf ("Last login: %.19s on %s",
  970.                  ctime (&lastlog.ll_time), lastlog.ll_line);
  971. -#ifdef    SVR4
  972.              if (lastlog.ll_host[0])
  973.                  printf(" from %.16s", lastlog.ll_host);
  974. -#endif
  975.              printf("\n");
  976.          }
  977.  #ifdef    AGING
  978. --- log.c
  979. +++ log.c    1994/04/17 17:59:14
  980. @@ -36,14 +36,6 @@
  981.  
  982.  #include "lastlog.h"
  983.  
  984. -#ifndef    LASTLOG_FILE
  985. -#ifdef    SVR4
  986. -#define    LASTLOG_FILE    "/var/adm/lastlog"
  987. -#else
  988. -#define    LASTLOG_FILE    "/usr/adm/lastlog"
  989. -#endif    /* SVR4 */
  990. -#endif    /* LASTLOG_FILE */
  991. -
  992.  extern    struct    utmp    utent;
  993.  #ifdef    SVR4
  994.  extern    struct    utmpx    utxent;
  995. @@ -73,7 +65,7 @@
  996.       * If the file does not exist, don't create it.
  997.       */
  998.  
  999. -    if ((fd = open (LASTLOG_FILE, O_RDWR)) == -1)
  1000. +    if ((fd = open (LASTFILE, O_RDWR)) == -1)
  1001.          return;
  1002.  
  1003.      /*
  1004. @@ -104,9 +96,7 @@
  1005.  
  1006.      (void) time (&newlog.ll_time);
  1007.      (void) strncpy (newlog.ll_line, utent.ut_line, sizeof newlog.ll_line);
  1008. -#ifdef    SVR4
  1009. -    (void) strncpy (newlog.ll_host, utxent.ut_host, sizeof newlog.ll_host);
  1010. -#endif
  1011. +    (void) strncpy (newlog.ll_host, utent.ut_host, sizeof newlog.ll_host);
  1012.      (void) lseek (fd, offset, 0);
  1013.      (void) write (fd, (char *) &newlog, sizeof newlog);
  1014.      (void) close (fd);
  1015. --- login.1
  1016. +++ login.1    1994/04/17 17:59:14
  1017. @@ -79,7 +79,7 @@
  1018.  .SH Files
  1019.  /etc/utmp \- list of current login sessions
  1020.  .br
  1021. -/etc/wtmp \- list of previous login sessions
  1022. +/var/adm/wtmp \- list of previous login sessions
  1023.  .br
  1024.  /etc/passwd \- user account information
  1025.  .br
  1026. --- login.defs
  1027. +++ login.defs    1994/04/17 17:59:14
  1028. @@ -1,8 +1,6 @@
  1029.  #
  1030.  # /etc/login.defs - Configuration control definitions for the login package.
  1031.  #
  1032. -#    @(#)login.defs    3.7    09:32:02    30 Apr 1993
  1033. -#
  1034.  # Three items must be defined:  MAIL_DIR, ENV_SUPATH, and ENV_PATH.
  1035.  # If unspecified, some arbitrary (and possibly incorrect) value will
  1036.  # be assumed.  All other items are optional - if not specified then
  1037. @@ -12,27 +10,33 @@
  1038.  #
  1039.  
  1040.  #
  1041. +# login string        (%u is replaced with username)
  1042. +#
  1043. +LOGIN_STRING  "Password: "                      # traditional
  1044. +#LOGIN_STRING "%u's Password: "                 # shadow password suite style
  1045. +
  1046. +#
  1047.  # Delay in seconds before being allowed another attempt after a login failure
  1048.  #
  1049. -FAIL_DELAY        5
  1050. +FAIL_DELAY        1
  1051.  
  1052.  #
  1053.  # Enable additional passwords upon dialup lines specified in /etc/dialups.
  1054.  #
  1055. -DIALUPS_CHECK_ENAB    yes
  1056. +DIALUPS_CHECK_ENAB    no
  1057.  
  1058.  #
  1059. -# Enable logging and display of /usr/adm/faillog login failure info.
  1060. +# Enable logging and display of /var/adm/faillog login failure info.
  1061.  #
  1062.  FAILLOG_ENAB        yes
  1063.  
  1064.  #
  1065.  # Enable display of unknown usernames when login failures are recorded.
  1066.  #
  1067. -LOG_UNKFAIL_ENAB    yes
  1068. +LOG_UNKFAIL_ENAB    no
  1069.  
  1070.  #
  1071. -# Enable logging and display of /usr/adm/lastlog login time info.
  1072. +# Enable logging and display of /var/adm/lastlog login time info.
  1073.  #
  1074.  LASTLOG_ENAB        yes
  1075.  
  1076. @@ -44,12 +48,12 @@
  1077.  #
  1078.  # Enable additional checks upon password changes.
  1079.  #
  1080. -OBSCURE_CHECKS_ENAB    yes
  1081. +OBSCURE_CHECKS_ENAB    no
  1082.  
  1083.  #
  1084.  # Enable checking of time restrictions specified in /etc/porttime.
  1085.  #
  1086. -PORTTIME_CHECKS_ENAB    yes
  1087. +PORTTIME_CHECKS_ENAB    no
  1088.  
  1089.  #
  1090.  # Enable setting of ulimit, umask, and niceness from passwd gecos field.
  1091. @@ -60,32 +64,30 @@
  1092.  # Enable "syslog" logging of su activity - in addition to sulog file logging.
  1093.  # SYSLOG_SG_ENAB does the same for newgrp and sg.
  1094.  #
  1095. -SYSLOG_SU_ENAB        no
  1096. -SYSLOG_SG_ENAB        no
  1097. +SYSLOG_SU_ENAB        yes
  1098. +SYSLOG_SG_ENAB        yes
  1099.  
  1100.  #
  1101.  # If defined, either full pathname of a file containing device names or
  1102.  # a ":" delimited list of device names.  Root logins will be allowed only
  1103.  # upon these devices.
  1104.  #
  1105. -CONSOLE        /etc/consoles
  1106. -#CONSOLE    console:tty01:tty02:tty03:tty04
  1107. +CONSOLE    tty1:tty2:tty3:tty4:tty5:tty6:tty7:tty8
  1108.  
  1109.  #
  1110.  # If defined, all su activity is logged to this file.
  1111.  #
  1112. -SULOG_FILE    /usr/adm/sulog
  1113. +SULOG_FILE    /var/adm/sulog
  1114.  
  1115.  #
  1116.  # If defined, ":" delimited list of "message of the day" files to
  1117.  # be displayed upon login.
  1118.  #
  1119.  MOTD_FILE    /etc/motd
  1120. -#MOTD_FILE    /etc/motd:/usr/lib/news/news-motd
  1121.  
  1122.  #
  1123.  # If set to "yes" /etc/issue will be output before each login prompt
  1124. -ISSUE_FILE_ENAB    yes
  1125. +ISSUE_FILE_ENAB        no
  1126.  
  1127.  #
  1128.  # If defined, file which maps tty line to TERM environment parameter.
  1129. @@ -96,14 +98,14 @@
  1130.  #
  1131.  # If defined, login failures will be logged here in a utmp format.
  1132.  #
  1133. -FTMP_FILE    /etc/ftmp
  1134. +#FTMP_FILE    /var/adm/ftmp
  1135.  
  1136.  #
  1137.  # If defined, name of file whose presence which will inhibit non-root
  1138.  # logins.  The contents of this file should be a message indicating
  1139.  # why logins are inhibited.
  1140.  #
  1141. -NOLOGINS_FILE    /etc/nologins
  1142. +NOLOGINS_FILE    /etc/nologin
  1143.  
  1144.  #
  1145.  # If defined, the command name to display when running "su -".  For
  1146. @@ -118,7 +120,7 @@
  1147.  #   Directory where mailboxes reside, _or_ name of file, relative to the
  1148.  #   home directory.  If you _do_ define both, MAIL_DIR takes precedence.
  1149.  #
  1150. -MAIL_DIR    /usr/spool/mail
  1151. +MAIL_DIR    /var/spool/mail
  1152.  #MAIL_FILE    .mail
  1153.  
  1154.  #
  1155. @@ -133,6 +135,7 @@
  1156.  #
  1157.  # If defined, the presence of this value in an /etc/passwd "shell" field will
  1158.  # disable logins for that user, although "su" will still be allowed.
  1159. +# This option is not implemented right now...
  1160.  #
  1161.  NOLOGIN_STR    NOLOGIN
  1162.  
  1163. @@ -140,19 +143,19 @@
  1164.  # If defined, either a TZ environment parameter spec or the
  1165.  # fully-rooted pathname of a file containing such a spec.
  1166.  #
  1167. -ENV_TZ        TZ=CST6CDT
  1168. -#ENV_TZ        /etc/tzname
  1169. +#ENV_TZ        TZ=CST6CDT
  1170. +ENV_TZ        /usr/lib/zoneinfo/localtime
  1171.  
  1172.  #
  1173.  # If defined, an HZ environment parameter spec.
  1174.  #
  1175. -ENV_HZ        HZ=50
  1176. +ENV_HZ        HZ=100
  1177.  
  1178.  #
  1179.  # *REQUIRED*  The default PATH settings, for superuser and normal users.
  1180.  #
  1181. -ENV_SUPATH    PATH=/etc/local:/etc:/local/bin:/usr/bin:/bin
  1182. -ENV_PATH    PATH=/local/bin:/usr/bin:/bin
  1183. +ENV_SUPATH    PATH=/sbin:/usr/sbin:/usr/bin:/bin:/usr/X386/bin:/usr/TeX/bin
  1184. +ENV_PATH    PATH=/usr/local/bin:/usr/bin:/bin:/usr/X386/bin:/usr/TeX/bin
  1185.  
  1186.  #
  1187.  # Terminal permissions
  1188. @@ -182,7 +185,7 @@
  1189.  #
  1190.  # Prefix these values with "0" to get octal, "0x" to get hexadecimal.
  1191.  #
  1192. -ERASECHAR    010
  1193. +ERASECHAR    127
  1194.  KILLCHAR    025
  1195.  UMASK        022
  1196.  ULIMIT        2097152
  1197. @@ -198,5 +201,5 @@
  1198.  PASS_MAX_DAYS    99999
  1199.  PASS_MIN_DAYS    0
  1200.  PASS_MIN_LEN    5
  1201. -PASS_WARN_AGE    7
  1202. +PASS_WARN_AGE    14
  1203.  
  1204. --- newgrp.c
  1205. +++ newgrp.c    1994/04/17 17:59:14
  1206. @@ -12,6 +12,7 @@
  1207.   * no warrantee of any kind.
  1208.   */
  1209.  
  1210. +#include "ngroups.h"
  1211.  #include <sys/types.h>
  1212.  #ifndef    BSD
  1213.  #include <string.h>
  1214. @@ -35,9 +36,9 @@
  1215.  static    char    sccsid[] = "@(#)newgrp.c    3.11    07:34:23    08 Apr 1993";
  1216.  #endif
  1217.  
  1218. -#ifdef    NGROUPS
  1219. +#ifdef    NGROUPS_MAX
  1220.  int    ngroups;
  1221. -gid_t    groups[NGROUPS];
  1222. +gid_t    groups[NGROUPS_MAX];
  1223.  #endif
  1224.  
  1225.  char    *getpass();
  1226. @@ -60,7 +61,9 @@
  1227.  #ifdef    USE_SYSLOG
  1228.  #include <syslog.h>
  1229.  
  1230. +#ifndef __linux__
  1231.  /*VARARGS*/ int syslog();
  1232. +#endif
  1233.  
  1234.  #ifndef    LOG_WARN
  1235.  #define    LOG_WARN LOG_WARNING
  1236. @@ -248,7 +251,6 @@
  1237.              }
  1238.          }
  1239.      }
  1240. -#ifdef    NGROUPS
  1241.  
  1242.      /*
  1243.       * get the current users groupset.  the new group will be
  1244. @@ -257,10 +259,11 @@
  1245.       * group id's are set.
  1246.       */
  1247.  
  1248. -    ngroups = getgroups (0, 0);
  1249. -    if (ngroups > 0)
  1250. +    if (NGROUPS_MAX > 1) {
  1251. +      ngroups = getgroups (0, 0);
  1252. +      if (ngroups > 0)
  1253.          getgroups (ngroups, groups);
  1254. -#endif
  1255. +    }
  1256.  
  1257.      /*
  1258.       * now we put her in the new group.  the password file entry for
  1259. @@ -425,7 +428,7 @@
  1260.          syslog (LOG_INFO, "user `%s' switched to group `%s'\n", name, group);
  1261.  #endif
  1262.      gid = grp->gr_gid;
  1263. -#ifdef    NGROUPS
  1264. +#ifdef    NGROUPS_MAX
  1265.  
  1266.      /*
  1267.       * i am going to try to add her new group id to her concurrent
  1268. @@ -439,7 +442,7 @@
  1269.              break;
  1270.      }
  1271.      if (i == ngroups) {
  1272. -        if (ngroups == NGROUPS) {
  1273. +        if (ngroups == NGROUPS_MAX) {
  1274.              fprintf (stderr, "too many groups\n");
  1275.          } else {
  1276.              groups[ngroups++] = gid;
  1277. --- newusers.8
  1278. +++ newusers.8    1994/04/17 17:59:14
  1279. @@ -33,15 +33,13 @@
  1280.  group is given, a new group will be created having this number.
  1281.  .IP "pw_dir"
  1282.  This field will be checked for existence as a directory and a new
  1283. -directory will the same name created if it does not already exist.
  1284. +directory with the same name will be created if it does not already exist.
  1285.  The ownership of the directory will be set to be that of the user
  1286.  being created or updated.
  1287.  .PP
  1288.  This command is intended to be used in a large system environment where
  1289.  many accounts are updated at a single time.
  1290.  .SH CAVEATS
  1291. -The \fImkpasswd\fR command must be executed afterwards to update the
  1292. -DBM password files.
  1293.  The input file must be protected since it contains unencrypted passwords.
  1294.  .SH SEE ALSO
  1295. -mkpasswd(8), passwd(1), useradd(1)
  1296. +passwd(1), useradd(1)
  1297. --- ngroups.h
  1298. +++ ngroups.h    1994/04/17 17:59:14
  1299. @@ -0,0 +1,15 @@
  1300. +#include <unistd.h>
  1301. +
  1302. +#ifdef _POSIX_VERSION
  1303. +#include <limits.h>
  1304. +#if !defined(NGROUPS_MAX) || NGROUPS_MAX < 1
  1305. +#undef NGROUPS_MAX
  1306. +#define NGROUPS_MAX sysconf (_SC_NGROUPS_MAX)
  1307. +#endif /* !NGROUPS_MAX */
  1308. +
  1309. +#else /* not _POSIX_VERSION */
  1310. +#include <sys/param.h>
  1311. +#if !defined(NGROUPS_MAX) && defined(NGROUPS)
  1312. +#define NGROUPS_MAX NGROUPS
  1313. +#endif /* not NGROUPS_MAX and NGROUPS */
  1314. +#endif /* not _POSIX_VERSION */
  1315. --- obscure.c
  1316. +++ obscure.c    1994/04/17 17:59:14
  1317. @@ -80,8 +80,10 @@
  1318.      char    *FascistCheck();
  1319.  #endif
  1320.  
  1321. +#if 0
  1322.      if (old[0] == '\0')
  1323.          return (1);
  1324. +#endif
  1325.  
  1326.      if ( strlen(new) < getdef_num("PASS_MIN_LEN", 0) ) {
  1327.          printf ("Too short.  ");
  1328. @@ -114,7 +116,7 @@
  1329.      if (similiar (newmono, oldmono))    /* jumbled version */
  1330.          return (0);
  1331.  
  1332. -    if (simple (old, new))            /* keyspace size */
  1333. +    if (simple (new, old))            /* keyspace size */
  1334.          return (0);
  1335.  
  1336.      strcpy (wrapped, oldmono);
  1337. @@ -143,7 +145,7 @@
  1338.   */
  1339.  
  1340.  /*ARGSUSED*/
  1341. -int    palindrome (old, new)
  1342. +int    palindrome (new, old)
  1343.  char    *old;
  1344.  char    *new;
  1345.  {
  1346. @@ -164,7 +166,7 @@
  1347.   */
  1348.  
  1349.  /*ARGSUSED*/
  1350. -int    similiar (old, new)
  1351. +int    similiar (new, old)
  1352.  char    *old;
  1353.  char    *new;
  1354.  {
  1355. @@ -187,7 +189,7 @@
  1356.   */
  1357.  
  1358.  /*ARGSUSED*/
  1359. -int    simple (old, new)
  1360. +int    simple (new, old)
  1361.  char    *old;
  1362.  char    *new;
  1363.  {
  1364. --- passwd.1
  1365. +++ passwd.1    1994/04/17 17:59:14
  1366. @@ -70,15 +70,15 @@
  1367.  Both entries are require to match in order for the password
  1368.  to be changed.
  1369.  .SS Group passwords
  1370. -When the \fB-g\f option is used, the password for the named
  1371. +When the \fB-g\fR option is used, the password for the named
  1372.  group is changed.
  1373.  The user must either be the super user, or a group administrator
  1374.  for the named group.
  1375.  The current group password is not prompted for.
  1376. -The \fB-r\f option is used with the \fB-g\f option to remove
  1377. +The \fB-r\fR option is used with the \fB-g\fR option to remove
  1378.  the current password from the named group.
  1379.  This allows group access to all members.
  1380. -The \fB-R\f option is used with the \fB-g\f option to restrict
  1381. +The \fB-R\fR option is used with the \fB-g\fR option to restrict
  1382.  the named group for all users.
  1383.  .SS Password expiry information
  1384.  The password aging information may be changed by the super
  1385. --- passwd.c
  1386. +++ passwd.c    1994/04/17 17:59:14
  1387. @@ -295,6 +295,10 @@
  1388.  char    *passwd;
  1389.  char    *result;
  1390.  {
  1391. +    if (! string || ! *string) {
  1392. +        while (*passwd)
  1393. +            *result++ = *passwd++;
  1394. +    } else {
  1395.      while (*string) {
  1396.          if (string[0] == ';') {
  1397.              *result++ = *string++;
  1398. @@ -309,6 +313,7 @@
  1399.                  string++;
  1400.          }
  1401.      }
  1402. +    }
  1403.      *result = '\0';
  1404.  }
  1405.  
  1406. @@ -361,6 +366,8 @@
  1407.          strcpy (orig, clear);
  1408.          bzero (cipher, strlen (cipher));
  1409.          bzero (clear, strlen (clear));
  1410. +    } else {
  1411. +      orig[0] = '\0';
  1412.      }
  1413.  
  1414.      /*
  1415. @@ -371,7 +378,7 @@
  1416.       */
  1417.  
  1418.      printf (NEWPASSMSG, getdef_num ("PASS_MIN_LEN", 5));
  1419. -    for (i = 0;i < 3;i++) {
  1420. +    for (i = 0;i < 5;i++) {
  1421.          if (! (cp = getpass (NEWPASS))) {
  1422.              bzero (orig, sizeof orig);
  1423.              return -1;
  1424. @@ -395,7 +402,7 @@
  1425.      }
  1426.      bzero (orig, sizeof orig);
  1427.  
  1428. -    if (i == 3) {
  1429. +    if (i == 5) {
  1430.          bzero (pass, sizeof pass);
  1431.          return -1;
  1432.      }
  1433. --- pwauth.c
  1434. +++ pwauth.c    1994/04/17 17:59:14
  1435. @@ -28,7 +28,7 @@
  1436.  static    char    sccsid[] = "@(#)pwauth.c    3.6    08:57:46    10 Jun 1993";
  1437.  #endif
  1438.  
  1439. -char    *PROMPT = "%s's Password:";
  1440. +char    *PROMPT = "Password: ";
  1441.  
  1442.  /*
  1443.   * _old_auth - perform getpass/crypt authentication
  1444. @@ -38,6 +38,11 @@
  1445.   *    compared.
  1446.   */
  1447.  
  1448. +char    *getpass ();
  1449. +char    *pw_encrypt ();
  1450. +char    *pwloginstr();
  1451. +char    *getdef_str();
  1452. +
  1453.  int
  1454.  _old_auth (cipher, user, reason, input)
  1455.  char    *cipher;
  1456. @@ -93,7 +98,11 @@
  1457.       */
  1458.  
  1459.      if (reason != PW_FTP && reason != PW_REXEC) {
  1460. -        sprintf (prompt, PROMPT, user);
  1461. +        if (getdef_str("LOGIN_STRING") == NULL)
  1462. +            sprintf (prompt,"%s", PROMPT);
  1463. +        else
  1464. +            sprintf (prompt, "%s", pwloginstr(prompt,sizeof prompt,
  1465. +                getdef_str("LOGIN_STRING"), user));
  1466.          clear = getpass (prompt);
  1467.      }
  1468.  
  1469. --- pwauth.h
  1470. +++ pwauth.h    1994/04/17 17:59:14
  1471. @@ -14,11 +14,7 @@
  1472.   *    @(#)pwauth.h    3.2    17:40:49    01 May 1993
  1473.   */
  1474.  
  1475. -#if    __STDC__
  1476. -int    pw_auth (char * program, char * user, int flag, char * input);
  1477. -#else
  1478.  int    pw_auth ();
  1479. -#endif
  1480.  
  1481.  /*
  1482.   * Local access
  1483. --- pwck.c
  1484. +++ pwck.c    1994/04/17 17:59:14
  1485. @@ -75,7 +75,7 @@
  1486.  char    *CANTUPDATE = "%s: cannot update file %s\n";
  1487.  char    *CHANGES = "%s: the files have been updated; run mkpasswd\n";
  1488.  char    *NOCHANGES = "%s: no changes\n";
  1489. -char    *NOGROUP = "user %s: no group %d\n";
  1490. +char    *_NOGROUP = "user %s: no group %d\n";    /* NOGROUP is a macro in linux */
  1491.  char    *NOHOME = "user %s: directory %s does not exist\n";
  1492.  char    *NOSHELL = "user %s: program %s does not exist\n";
  1493.  char    *BADENTRY = "invalid password file entry\n";
  1494. @@ -401,7 +401,7 @@
  1495.               * No primary group, just give a warning
  1496.               */
  1497.  
  1498. -            printf (NOGROUP, pwd->pw_name, pwd->pw_gid);
  1499. +            printf (_NOGROUP, pwd->pw_name, pwd->pw_gid);
  1500.              errors++;
  1501.          }
  1502.  
  1503. --- pwloginstr.c
  1504. +++ pwloginstr.c    1994/04/17 17:59:14
  1505. @@ -0,0 +1,218 @@
  1506. +/*
  1507. + *  pwloginstr.c    v1.1        
  1508. + *
  1509. + *  loginstr() parsing
  1510. + *
  1511. + *  Copyright (C), 1994    Riku Meskanen - mesrik@tukki.jyu.fi
  1512. + */
  1513. +
  1514. +/*
  1515. +This file is free software; you can redistribute it and/or modify
  1516. +it under the terms of the GNU General Public License as published by
  1517. +the Free Software Foundation; either version 2, or (at your option)
  1518. +any later version.
  1519. +
  1520. +This file is distributed in the hope that it will be useful,
  1521. +but WITHOUT ANY WARRANTY; without even the implied warranty of
  1522. +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  1523. +GNU General Public License for more details.
  1524. +
  1525. +I you don't have a copy of the GNU General Public License
  1526. +write to the Free Software Foundation, 675 Mass Ave, 
  1527. +Cambridge, MA 02139, USA.  
  1528. +*/
  1529. +
  1530. +#include <stdio.h>
  1531. +#include <ctype.h>
  1532. +#include <stdlib.h>
  1533. +#include <string.h>
  1534. +
  1535. +static void
  1536. +warning(s)
  1537. +char *s;
  1538. +{
  1539. +     fprintf(stderr,"Warning: /etc/login.defs LOGIN_STRING %s.\n", s);
  1540. +}
  1541. +
  1542. +static    char    *LOGIN_DEFAULT = "Password :";
  1543. +static  char    *too_long      = "too long";
  1544. +static  char    *bad_escape    = "syntax error, bad escape";
  1545. +static  char    *null_string   = "syntax error, parsed string null";
  1546. +static  char    *quote_missing = "syntax error, quote-mark missing";
  1547. +
  1548. +char
  1549. +*pwloginstr(trgt, tmax, fmt, user)
  1550. +char *trgt;
  1551. +size_t tmax;
  1552. +char *fmt;
  1553. +char *user;
  1554. +{
  1555. +    char  *rp;    /* parse read pointer */
  1556. +    char  *tp;    /* target pointer */
  1557. +    short  ql;    /* quote level */
  1558. +    size_t ts;  /* target size */
  1559. +    size_t tmp; /* temp sizer */
  1560. +
  1561. +    tp = trgt;
  1562. +    *tp= '\0';
  1563. +    ql = 0;
  1564. +    ts = 0;
  1565. +
  1566. +    while (*fmt && ql != -1) {
  1567. +        switch (*fmt) {
  1568. +            case '"' :     if (!ql) {  /* quote */
  1569. +                ++ql;    /* enter in quoted string */
  1570. +                            ++fmt;
  1571. +                continue;
  1572. +                        }
  1573. +            ql = -1;    /* exit from quoted string */
  1574. +            break;
  1575. +
  1576. +            case '\\' : if (!ql) {
  1577. +                           warning(quote_missing);
  1578. +                           return LOGIN_DEFAULT;
  1579. +                        }
  1580. +
  1581. +                        if (ts +2 > tmax) {     /* char + nul */
  1582. +                           warning(too_long);
  1583. +                           return LOGIN_DEFAULT;
  1584. +                        }
  1585. +
  1586. +                        rp = NULL;
  1587. +                    switch (*(fmt +1)) {
  1588. +                                 case 'a' : *tp = '\a';  break;      /* BEL */
  1589. +                                 case 'b' : *tp = '\b';  break;      /* BS  */
  1590. +                                 case 'f' : *tp = '\f';  break;      /* FF  */
  1591. +                                 case 'n' : *tp = '\n';  break;      /* CR  */
  1592. +                                 case 'r' : *tp = '\r';  break;      /* LF  */
  1593. +                                 case 't' : *tp = '\t';  break;      /* HT  */
  1594. +                                 case 'v' : *tp = '\v';  break;      /* VT  */
  1595. +                                 case '\\': *tp = '\\';  break;      /* backspace */
  1596. +                                 case '?' : *tp = '\?';  break;      /* question mark */
  1597. +                                 case '\'': *tp = '\'';  break;      /* single quote  */
  1598. +                                 case '\"': *tp = '\"';  break;      /* double quote  */
  1599. +
  1600. +                                 /* check if it's valid hex, octal or decimal
  1601. +                                  * syntax: 0     prefixed octals            ( base  8 )
  1602. +                                  *         0x    "        hexadesimals      ( base 16 )
  1603. +                                  *         [1-9] "        decimal           ( base 10 )
  1604. +                                  */
  1605. +                                 default  : if (isdigit((int) *(fmt+1))) {
  1606. +                                                /* yeah i know -- this sure is BFMI code. We lose
  1607. +                         * some significant bits here, i don't care ;-)
  1608. +                         */
  1609. +                                                *tp = (char) strtol((const char *) (fmt+1), &rp, 0);
  1610. +                        
  1611. +                                                if (tp < rp)   /* did we get any bytes? */
  1612. +                                                    break;     /* yes, we did, so leave the case */
  1613. +                        }
  1614. +                        warning(bad_escape);  
  1615. +                        return LOGIN_DEFAULT;
  1616. +                }
  1617. +
  1618. +                if (rp == NULL)        /* did we visit strtol() ? */ 
  1619. +                   fmt += 2;        /* no, skip over C std escape */
  1620. +                        else
  1621. +                           fmt += rp - fmt;    /* yes, skip over octal etc... */
  1622. +
  1623. +                        ++tp;            /* adjust target and it's size */
  1624. +                        ++ts;
  1625. +            break;
  1626. +
  1627. +        case '%' :  if (!ql) {
  1628. +                            warning(quote_missing);
  1629. +                            return LOGIN_DEFAULT;
  1630. +                        }
  1631. +                        switch (*(fmt +1)) {
  1632. +                        /* %u to username */
  1633. +                case 'u':       if (ts + (tmp = strlen(user)) > tmax) {
  1634. +                                                   warning(too_long);
  1635. +                                                   return LOGIN_DEFAULT;
  1636. +                                                }
  1637. +                                                strcat(tp,user);
  1638. +                        tp += tmp;    /* adjust target pointer */
  1639. +                                                ts += tmp;     /* and size */
  1640. +                                                tmp = 0;       /* safe, if used later elsewere */
  1641. +                        ++fmt;
  1642. +                        break;
  1643. +                        /* anything else is % itself */
  1644. +                default:    if (ts +2 > tmax) {
  1645. +                           warning(too_long);
  1646. +                           return LOGIN_DEFAULT;    
  1647. +                        }
  1648. +                        *tp++ = '%';
  1649. +                        ++ts;
  1650. +                        break;
  1651. +            }
  1652. +            ++fmt;
  1653. +            break;
  1654. +
  1655. +        default   : if (!ql) {  /* if not in quoted string */
  1656. +                while (*fmt && *fmt != '"')    /* get first quote */
  1657. +                                      ++fmt;
  1658. +                break;
  1659. +            }
  1660. +            *tp = *fmt;
  1661. +            ++fmt;
  1662. +            ++tp;
  1663. +                        ++ts;
  1664. +        }    /* switch */
  1665. +
  1666. +    *tp = '\0';
  1667. +
  1668. +    }    /* while */
  1669. +
  1670. +    if (ql > 0 ) {
  1671. +       warning(quote_missing);
  1672. +       return LOGIN_DEFAULT;
  1673. +    }
  1674. +
  1675. +
  1676. +    if (ts == 0) {    /* if target is empty */
  1677. +        warning(null_string);
  1678. +        return LOGIN_DEFAULT;
  1679. +    }
  1680. +
  1681. +    return trgt;
  1682. +}
  1683. +
  1684. +
  1685. +#ifdef __TEST__
  1686. +/*
  1687. + *   simple test
  1688. + */
  1689. +
  1690. +char *
  1691. +getstring(msg, str, mlen)
  1692. +char *msg;
  1693. +char *str;
  1694. +int  mlen;
  1695. +{
  1696. +    char *s;
  1697. +
  1698. +        printf("%s ", msg);
  1699. +    if ((s = fgets(str, mlen, stdin)) != NULL && *s != '\n') {
  1700. +        *(s + strlen(s) -1) = '\0';    /* remove newline */
  1701. +        return s;
  1702. +    }
  1703. +        else
  1704. +            return NULL;
  1705. +}
  1706. +
  1707. +int
  1708. +main()
  1709. +{
  1710. +    char ls[80];
  1711. +    char fmt[60];
  1712. +    char usr[32];
  1713. +    
  1714. +    while (getstring("LOGIN_STRING: ", fmt, sizeof(fmt)) &&
  1715. +           getstring("USER: ", usr, sizeof(usr))) {
  1716. +         printf("PROMPT: %s\n", pwloginstr(ls, sizeof(ls), fmt, usr) );
  1717. +    }
  1718. +
  1719. +    return 0;
  1720. +}
  1721. +
  1722. +#endif
  1723. +/* eof pwloginstr.c */
  1724. --- setup.c
  1725. +++ setup.c    1994/04/17 17:59:15
  1726. @@ -12,6 +12,7 @@
  1727.   * no warrantee of any kind.
  1728.   */
  1729.  
  1730. +#include "ngroups.h"
  1731.  #include <sys/types.h>
  1732.  #include <utmp.h>
  1733.  
  1734. @@ -151,7 +152,7 @@
  1735.  
  1736.      /*
  1737.       * See if the GECOS field contains values for NICE, UMASK or ULIMIT.
  1738. -     * If this feature is enabled in /etc/login.defs, we makes those
  1739. +     * If this feature is enabled in /etc/login.defs, we make those
  1740.       * values the defaults for this login session.
  1741.       */
  1742.  
  1743. @@ -198,14 +199,13 @@
  1744.  #endif
  1745.          exit (errno);
  1746.      }
  1747. -#if NGROUPS > 1
  1748.  
  1749.      /*
  1750.       * For systems which support multiple concurrent groups, go get
  1751.       * the group set from the /etc/group file.
  1752.       */
  1753.  
  1754. -    if (initgroups (info->pw_name, info->pw_gid) == -1) {
  1755. +    if (NGROUPS_MAX > 1 && initgroups (info->pw_name, info->pw_gid) == -1) {
  1756.          puts ("initgroups failure");
  1757.  #ifdef    USE_SYSLOG
  1758.          syslog (LOG_WARN, "initgroups failed for user `%s'\n",
  1759. @@ -214,7 +214,6 @@
  1760.  #endif
  1761.          exit (errno);
  1762.      }
  1763. -#endif /* NGROUPS > 1 */
  1764.  
  1765.      /*
  1766.       * Set the real UID to the UID value in the password file.
  1767. --- shadow.4
  1768. +++ shadow.4    1994/04/17 17:59:15
  1769. @@ -71,6 +71,4 @@
  1770.  su(1),
  1771.  sulogin(1M),
  1772.  shadow(3),
  1773. -passwd(4),
  1774. -pwconv(8),
  1775. -pwunconv(8)
  1776. +passwd(4)
  1777. --- shadow.c
  1778. +++ shadow.c    1994/04/17 17:59:15
  1779. @@ -9,9 +9,9 @@
  1780.   * distribution media.
  1781.   */
  1782.  
  1783. -#include "shadow.h"
  1784.  #include "config.h"
  1785.  #include <stdio.h>
  1786. +#include "shadow.h"
  1787.  
  1788.  #ifdef    STDLIB_H
  1789.  #include <stdlib.h>
  1790. @@ -201,9 +201,6 @@
  1791.  
  1792.  struct spwd
  1793.  *getspnam (name)
  1794. -#if    __STDC__
  1795. -const
  1796. -#endif
  1797.  char    *name;
  1798.  {
  1799.      struct    spwd    *sp;
  1800. --- smain.c
  1801. +++ smain.c    1994/04/17 17:59:15
  1802. @@ -48,7 +48,9 @@
  1803.  #ifdef    USE_SYSLOG
  1804.  #include <syslog.h>
  1805.  
  1806. +#ifndef __linux__
  1807.  /*VARARGS*/ int syslog();
  1808. +#endif
  1809.  
  1810.  #ifndef    LOG_WARN
  1811.  #define    LOG_WARN LOG_WARNING
  1812. @@ -115,9 +117,11 @@
  1813.  extern    char    *tz ();
  1814.  extern    char    *pw_encrypt();
  1815.  extern    int    pw_auth();
  1816. +#ifndef __linux__
  1817.  extern    struct    passwd    *getpwuid ();
  1818.  extern    struct    passwd    *getpwnam ();
  1819.  extern    struct    spwd    *getspnam ();
  1820. +#endif
  1821.  extern    char    *getdef_str();
  1822.  extern    int    getdef_bool();
  1823.  extern    char    **environ;
  1824. @@ -344,9 +348,9 @@
  1825.  #ifdef    USE_SYSLOG
  1826.          if ( getdef_bool("SYSLOG_SU_ENAB") )
  1827.              syslog (pwent.pw_uid ? LOG_INFO:LOG_CRIT,
  1828. -                "- %s %s-%s\n", tty,
  1829. -                oldname[0] ? oldname:"???",
  1830. -                name[0] ? name:"???");
  1831. +                "'su %s' failed for %s on /dev/%s\n",
  1832. +                name[0] ? name:"???",
  1833. +                oldname[0] ? oldname:"???", tty);
  1834.          closelog ();
  1835.  #endif
  1836.          exit (1);
  1837. @@ -401,8 +405,8 @@
  1838.      endspent ();
  1839.  #ifdef    USE_SYSLOG
  1840.      if ( getdef_bool("SYSLOG_SU_ENAB") )
  1841. -        syslog (LOG_INFO, "+ %s %s-%s\n", tty,
  1842. -            oldname[0] ? oldname:"???", name[0] ? name:"???");
  1843. +        syslog (LOG_INFO, "'su %s' succeeded for %s on /dev/%s\n",
  1844. +            name[0] ? name:"???", oldname[0] ? oldname:"???", tty);
  1845.  #endif
  1846.      if (fakelogin)
  1847.          setup (&pwent);        /* set UID, GID, HOME, etc ... */
  1848. --- sppwd.c
  1849. +++ sppwd.c    1994/04/17 17:59:15
  1850. @@ -0,0 +1,58 @@
  1851. +#undef SHADOW_PWD
  1852. +#include <stdio.h>
  1853. +#include <sys/types.h>
  1854. +#include <shadow.h>
  1855. +#include <pwd.h>
  1856. +#include <grp.h>
  1857. +#include <unistd.h>
  1858. +
  1859. +struct passwd *_spsubspwd(struct passwd *pw)
  1860. +{
  1861. +    struct spwd *spw; 
  1862. +    if (pw)
  1863. +    {    spw = getspnam(pw->pw_name);
  1864. +        if (spw)
  1865. +            pw->pw_passwd = spw->sp_pwdp;
  1866. +    }
  1867. +    return(pw);
  1868. +}
  1869. +
  1870. +struct group *_spsubsgrp(struct group *gr)
  1871. +{
  1872. +    struct sgrp *sgr; 
  1873. +    if (gr)
  1874. +    {    sgr = getsgnam(gr->gr_name);
  1875. +        if (sgr)
  1876. +            gr->gr_passwd = sgr->sg_passwd;
  1877. +    }
  1878. +    return(gr);
  1879. +}
  1880. +
  1881. +struct passwd *_spgetpwuid(uid_t  uid) { return(_spsubspwd(getpwuid(uid))); }
  1882. +
  1883. +struct passwd *_spgetpwnam(char  *name) { return(_spsubspwd(getpwnam(name))); }
  1884. +
  1885. +struct passwd *_spgetpwent(void) { return(_spsubspwd(getpwent())); }
  1886. +
  1887. +struct passwd *_spfgetpwent(FILE *F) { return(_spsubspwd(fgetpwent(F))); }
  1888. +
  1889. +struct group *_spgetgrgid(gid_t  gid) { return(_spsubsgrp(getgrgid(gid))); }
  1890. +
  1891. +struct group *_spgetgrnam(char  *name) { return(_spsubsgrp(getgrnam(name))); }
  1892. +
  1893. +struct group *_spgetgrent(void) { return(_spsubsgrp(getgrent())); }
  1894. +
  1895. +struct group *_spfgetgrent(FILE *F) { return(_spsubsgrp(fgetgrent(F))); }
  1896. +
  1897. +char *_spcrypt(char clear[], char salt[] )
  1898. +{
  1899. +    static char buffer[30];
  1900. +    char *cp = crypt (clear, salt);
  1901. +    strcpy (buffer, cp);
  1902. +    if (strlen (clear) > 8) {
  1903. +        cp = crypt (clear + 8, salt);
  1904. +        strcat (buffer, cp + 2);
  1905. +    }
  1906. +    return(buffer);
  1907. +}
  1908. +
  1909. --- sulog.c
  1910. +++ sulog.c    1994/04/17 17:59:15
  1911. @@ -60,9 +60,10 @@
  1912.      (void) time (&clock);
  1913.      tm = localtime (&clock);
  1914.  
  1915. -    (void) fprintf (fp, "SU %.02d/%0.2d %.02d:%.02d %c %.6s %s-%s\n",
  1916. +    (void) fprintf (fp, "SU %.02d/%0.2d %.02d:%.02d 'su %s'"
  1917. +        " %s for %s on /dev/%.6s\n",
  1918.          tm->tm_mon + 1, tm->tm_mday, tm->tm_hour, tm->tm_min,
  1919. -        success ? '+':'-', tty, oldname, name);
  1920. +        name, (success == 0)? "failed" : "succeeded", oldname, tty);
  1921.  
  1922.      fflush (fp);
  1923.      fclose (fp);
  1924. --- sulogin.c
  1925. +++ sulogin.c    1994/04/17 17:59:15
  1926. @@ -102,6 +102,7 @@
  1927.  #define    RETRIES    3
  1928.  #endif
  1929.  
  1930. +SIGTYPE
  1931.  catch (sig)
  1932.  int    sig;
  1933.  {
  1934. @@ -225,14 +226,14 @@
  1935.              closelog ();
  1936.  #endif
  1937.  #ifdef    TELINIT
  1938. -            execl ("/etc/telinit", "telinit", RUNLEVEL, (char *) 0);
  1939. +            execl (TELINIT, "telinit", RUNLEVEL, (char *) 0);
  1940.  #endif
  1941.              exit (0);
  1942.          } else
  1943.              strcpy (pass, cp);
  1944.  
  1945.          if (pwent.pw_name && pwent.pw_passwd[0] == '@') {
  1946. -            if (pw_auth (pwent.pw_passwd + 1, name, PW_LOGIN)) {
  1947. +            if (pw_auth (pwent.pw_passwd + 1, name, PW_LOGIN, "")) {
  1948.  #ifdef    USE_SYSLOG
  1949.                  syslog (LOG_WARN,
  1950.                      "Incorrect root authentication");
  1951. --- tz.c
  1952. +++ tz.c    1994/04/17 17:59:15
  1953. @@ -27,7 +27,7 @@
  1954.  char    *fname;
  1955.  {
  1956.      FILE *fp;
  1957. -    static char tzbuf[64];
  1958. +    static char tzbuf[1024];
  1959.  
  1960.      if ((fp = fopen(fname,"r")) == NULL)
  1961.          return "TZ=CST6CDT";
  1962. --- useradd.c
  1963. +++ useradd.c    1994/04/17 17:59:15
  1964. @@ -16,6 +16,7 @@
  1965.  static    char    sccsid[] = "@(#)useradd.c    3.14    08:20:53    23 Aug 1993";
  1966.  #endif
  1967.  
  1968. +#include "ngroups.h"
  1969.  #include "config.h"
  1970.  #include <sys/types.h>
  1971.  #include <sys/stat.h>
  1972. @@ -59,10 +60,6 @@
  1973.  char    def_file[] = "/usr/sadm/defadduser";
  1974.  #else
  1975.  char    def_file[] = "/etc/default/useradd";
  1976. -#endif
  1977. -
  1978. -#ifndef    NGROUPS_MAX
  1979. -#define    NGROUPS_MAX    64
  1980.  #endif
  1981.  
  1982.  #if !defined(MDY_DATE) && !defined(DMY_DATE) && !defined(YMD_DATE)
  1983. --- userdel.c
  1984. +++ userdel.c    1994/04/17 17:59:15
  1985. @@ -47,10 +47,6 @@
  1986.  #endif
  1987.  #endif
  1988.  
  1989. -#ifndef    NGROUPS_MAX
  1990. -#define    NGROUPS_MAX    64
  1991. -#endif
  1992. -
  1993.  #if defined(DIR_XENIX) || defined(DIR_BSD) || defined(DIR_SYSV)
  1994.  #define    DIR_ANY
  1995.  #endif
  1996. @@ -377,7 +373,7 @@
  1997.      struct    spwd    *spwd;
  1998.  
  1999.      if ((spwd = spw_locate (user_name)) && spwd->sp_pwdp[0] == '@') {
  2000. -        if (pw_auth (spwd->sp_pwdp + 1, user_name, PW_DELETE)) {
  2001. +        if (pw_auth (spwd->sp_pwdp + 1, user_name, PW_DELETE, "")) {
  2002.  #ifdef    USE_SYSLOG
  2003.              syslog (LOG_ERR,
  2004.                  "failed deleting auth `%s' for user `%s'\n",
  2005. @@ -397,7 +393,7 @@
  2006.      }
  2007.  #endif    /* SHADOWPWD */
  2008.      if ((pwd = pw_locate (user_name)) && pwd->pw_passwd[0] == '@') {
  2009. -        if (pw_auth (pwd->pw_passwd + 1, user_name, PW_DELETE)) {
  2010. +        if (pw_auth (pwd->pw_passwd + 1, user_name, PW_DELETE, "")) {
  2011.  #ifdef    USE_SYSLOG
  2012.              syslog (LOG_ERR,
  2013.                  "failed deleting auth `%s' for user `%s'\n",
  2014. @@ -520,22 +516,22 @@
  2015.  {
  2016.      char    buf[BUFSIZ];
  2017.  
  2018. -#ifdef    HAS_CRONTAB
  2019. +#ifdef    CRONTAB_REM
  2020.  
  2021.      /* 
  2022.       * Remove the crontab if there is one.
  2023.       */
  2024.  
  2025. -    sprintf (buf, "/bin/crontab -r -u %s", user);
  2026. +    sprintf (buf, CRONTAB_REM, user);
  2027.      system (buf);
  2028.  #endif
  2029. -#ifdef    HAS_ATRM
  2030. +#ifdef    ATRUN_REM
  2031.  
  2032.      /*
  2033.       * Remove any at jobs as well.
  2034.       */
  2035.  
  2036. -    sprintf (buf, "/bin/atrm -f %s", user);
  2037. +    sprintf (buf, ATRUN_REM, user);
  2038.      system (buf);
  2039.  #endif
  2040.  }
  2041. --- usermod.c
  2042. +++ usermod.c    1994/04/17 17:59:15
  2043. @@ -16,6 +16,7 @@
  2044.  static    char    sccsid[] = "@(#)usermod.c    3.16    08:11:52    07 May 1993";
  2045.  #endif
  2046.  
  2047. +#include "ngroups.h"
  2048.  #include <sys/types.h>
  2049.  #include <sys/stat.h>
  2050.  #include <stdio.h>
  2051. @@ -48,10 +49,6 @@
  2052.  #endif
  2053.  #endif
  2054.  
  2055. -#ifndef    NGROUPS_MAX
  2056. -#define    NGROUPS_MAX    64
  2057. -#endif
  2058. -
  2059.  #if defined(DIR_XENIX) || defined(DIR_BSD) || defined(DIR_SYSV)
  2060.  #define    DIR_ANY
  2061.  #endif
  2062. @@ -1619,7 +1616,7 @@
  2063.       * anything to just leave it be.
  2064.       */
  2065.  
  2066. -    if ((fd = open ("/usr/adm/lastlog", O_RDWR)) != -1) {
  2067. +    if ((fd = open (LASTFILE, O_RDWR)) != -1) {
  2068.          lseek (fd, (long) user_id * sizeof ll, 0);
  2069.          if (read (fd, &ll, sizeof ll) == sizeof ll) {
  2070.              lseek (fd, (long) user_newid * sizeof ll, 0);
  2071.